package com.itheima.springboottlias.mapper;


import Pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

/*
* 部门持久层接口：处理部门相关的持久层操作
* */
@Mapper
public interface DeptMapper {
    //查询部门列表
    @Select("select * from dept")
    public List<Dept> queryAll();




    //新增部门
    @Insert("insert into dept values (null,#{name},#{createTime},#{updateTime}) ")
    void saveDept(Dept dept);


    //删除部门
    @Delete("delete from dept where id = #{id}")
    void removeById(Integer id);



    //根据id查询部门
    @Select("select * from dept where id = #{id}")
    Dept findById(Integer id);


    //更新部门
    @Update("update dept set name = #{name},update_time = #{updateTime} where id = #{id}")
    void update(Dept dept);
}
